home *** CD-ROM | disk | FTP | other *** search
/ BBS Toolkit / BBS Toolkit.iso / doors_2 / stckdoor.zip / STOCK_IN.PRG < prev    next >
Text File  |  1992-08-03  |  2KB  |  86 lines

  1. * STOCK_IN.PRG
  2. * This routine pulls information from the file STOCK.LOG.  You will need to
  3. * modify it to fit your LOG file depending on where you get your STOCK quotes
  4. * If you download the file DAILY.ZIP and unzip it to DAILY.DBF on a daily basis
  5. * you will not need to use this routine at all.  DAILY.ZIP is about 75K and is
  6. * available on the Corporate Network
  7. *
  8. * Since I have no idea what your Stock Quote log file looks like I could only
  9. * provide the routine that I use.
  10. *
  11. * Registration of the Stock Door is $10 per year, or $25 per year with the
  12. * data file download option.
  13. *
  14. * You may use the download feature and the software free for 2 Months just
  15. * register on the Corporate Network (908)940-1045 leave a message for the SYSOP.
  16. *
  17. *═══════════════════════════════════════════════════════════════════════════════
  18. * Print the time to gate an idea of how long this takes
  19. ? time()
  20. * field to flag a bad log file
  21. badfile = .f.
  22. set safety off
  23. set talk off
  24. * Daily.DBF - daily stock quotes
  25. use daily
  26. * Make Backup Copy
  27. copy to olddaily
  28. zap
  29. ? "Appending from Stock.log"
  30. append from stock.log sdf
  31. go bottom
  32. if recno() <= 50
  33.    badfile = .t.
  34.    ? "Bad log file -- Too short "
  35. else
  36.    go top
  37.    do while recno() < 200
  38.       if (high = 'RARILY')
  39.          Badfile = .t.
  40.          ? "Badfile"
  41.       endif
  42.       skip
  43.    enddo
  44. endif
  45. if badfile
  46.    use olddaily
  47.    copy to daily
  48.    use daily index code
  49.    pack
  50.    quit
  51. endif
  52. ? "Delete Phase I"
  53. delete all for code = 'STOCK' .or. code = 'ENTER' .or. code = 'TRADE'
  54. ? "Delete Phase II"
  55. delete all for code = '     '
  56. ? "Create Invalid"
  57. copy to invalid for open = 'VALID'
  58. ? "Delete Phase III"
  59. delete all for open = 'VALID'
  60. go top
  61. n = 0
  62. set alternate to stock.txt
  63. set alternate on
  64. ? "┌──────────────────────────────────────────────────────────────────────┐"
  65. do While n= 0
  66.    if code = 'DOW JON' .or. code = 'TRANS' .or. substr(code,3,1) = '-'
  67. ? "│"+CODE+CLOSE+OPEN+HIGH+LOW+LAST+VOL+"│"
  68.    endif
  69.    if code = 'TRANS'
  70.       n = 1
  71.    endif
  72.    skip
  73. enddo
  74. ? "└──────────────────────────────────────────────────────────────────────┘"
  75. set alternate off
  76. set alternate to
  77. ? "Delete Phase IV"
  78. delete all for code = 'DOW JON' .or. code = 'TRANS' .or. (substr(code,3,1)='-' .and. substr(code,7,1)='-')
  79. ? "Pack Data"
  80. pack
  81. set index to code
  82. reindex
  83. ? Time()
  84. quit
  85.  
  86.